import request from '../utils/request';

// 导入实体节点
export const importEntities = (entities: string[]) => {
    return request.post('/graph/entities', entities, {
        headers: { 'Content-Type': 'application/json' },
    });
};

// 导入关系
export const importRelationships = (requestBody: Array<{
    from: string; // 起始节点的 label
    relationship: string; // 关系类型
    to: string; // 终止节点的 label
}>) => {
    return request.post('/graph/relationships', requestBody);
};

// 搜索图节点和关系
export const searchGraph = (keyword: string) => {
    return request.get('/graph/search', {
        params: { keyword },
    });
};
